/**
 * Created by huangxuehua on 2017/12/8.
 */
//$("header>a.goBack").click(function(){
//    window.history.go(-1)
//});
var xpHome = new Vue({
    el:'#app',
    data:{
        imgBaseUrl: nUrls.imgBaseUrl,//图片路径
        showGoodsList:[],//推荐信息列表
    },
    methods: {
        getImage:function(url){//加载图片  处理 url为空 加载出错
            if(url){
                return xpHome.imgBaseUrl+url;
            }
        },

        getGoodsInfo:function(){
            $.ajax({
                url: nUrls.getShowGoods,
                type:'post',
                success:function(data){
                    var result = eval('('+data+')');
                    if(result && result.code == 200){
                        //console.log(result)
                        xpHome.showGoodsList = result.data;
                        //console.log(xpHome.showGoodsList);
                    }
                },
                error:function(){
                    console.log("没有更多信息")
                }
            });
        },
        goDetail: function (goods_id) {//到产品详情页
            window.location.href = "../detail/goods_detail.html?id="+goods_id;
        },
        goOnLine:function(){  //断网刷新
            nUtils.onLine();
        }

    }
});
$(function(){
    xpHome.getGoodsInfo()
})
$("#coverPic").click(function(){  //遮罩层显示
    $("#shareDiv").show();
    $("#shareDiv").css({
        "position":"absolute",
        "top":"2.25rem",
        "width":"100%",
        "height":"100%",
        "background":"#555",
        "opacity":"0.6"
    })
});
$("#shareDiv").click(function(){
    $("#shareDiv").hide();
})
$("#fenXiang").click(function(){ //遮罩层隐藏，并分享
    $("#shareDiv").hide();

})/**
 * Created by huangxuehua on 2018/1/5.
 */
